Enhancing wind direction prediction of South Africa wind energy hotspots with Bayesian mixture modeling

Wind energy production depends not only on wind speed but also on wind direction. Thus, predicting and estimating the wind direction for sites accurately will enhance measuring the wind energy potential. The uncertain nature of wind direction can be presented through probability distributions and Bayesian analysis can improve the modeling of the wind direction using the contribution of the prior knowledge to update the empirical shreds of evidence. This must align with the nature of the empirical evidence as to whether the data are skew or multimodal or not. So far mixtures of von Mises within the directional statistics domain, are used for modeling wind direction to capture the multimodality nature present in the data. In this paper, due to the skewed and multimodal patterns of wind direction on different sites of the locations understudy, a mixture of multimodal skewed von Mises is proposed for wind direction. Furthermore, a Bayesian analysis is presented to take into account the uncertainty inherent in the proposed wind direction model. A simulation study is conducted to evaluate the performance of the proposed Bayesian model. This proposed model is fitted to datasets of wind direction of Marion island and two wind farms in South Africa and show the superiority of the approach. The posterior predictive distribution is applied to forecast the wind direction on a wind farm. It is concluded that the proposed model offers an accurate prediction by means of credible intervals. The mean wind direction of Marion island in 2017 obtained from 1079 observations was 5.0242 (in radian) while using our proposed method the predicted mean wind direction and its corresponding \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$95\%$$\end{document}95% credible interval based on 100 generated samples from the posterior predictive distribution are obtained 5.0171 and (4.7442, 5.2900). Therefore, our results open a new approach for accurate prediction of wind direction implementing a Bayesian approach via mixture of skew circular distributions.

The future of the energy industry lies in clean power that minimizes or entirely removes pollutants from the process of power generation. The perfect clean energy mix occurs where green energy, derived from natural sources, meets renewable energy from sources that are constantly being replenished. Wind energy is one of the most important sustainable forms of this ideal clean energy and one of the fastest-growing energy sources. A sophisticated knowledge, based on statistical analysis, of wind characteristics is crucial for the future harnessing of this important renewable energy resource. Wind power is developing as a renewable energy source in a number of countries and it will be increasingly important to find an effective and predictable way of integrating this intermittent but environmentally friendly power source into the existing electrical grid system.
In South Africa, there is an increasing transition towards an environmentally sustainable, climate-change resilient, low-carbon economy. In October 2020, the South African Wind Energy Association (SAWEA) reported that wind technology has already attracted R209.7 billion in investment for the development of projects in South Africa. In fact wind power comprises a larger share of the planned renewable energy investments to date. It is estimated by 2030 that 22.7% of the required electricity in South Africa, namely 17742 MW, will be generated from wind energy. In terms of job creation, the 22 wind Independent Power Producers (IPPs) that have successfully reached commercial operations to date, have created 2723 jobs for South African citizens.

Site location and wind data
The first dataset (A) shows the wind direction of Marion island which is recorded daily at 08:00, 14:00 and 20:00 South Africa standard time (SAST) (relates to the main synoptic hours). Marion Island is part of South Africa with a climate that is highly oceanic in nature, coupled with the influence of passing frontal weather systems. In fact, the geographic location of Marion Island, lying directly in the path of eastward moving depressions all year round make it an excellent location for meteorological studies. Powerful regional winds, colloquially known as the 'Roaring Forties' , so called as they have found between the latitudes of 40 • and 50 • in the Southern Hemisphere, blow almost every day in a north-westerly direction. The exceptional research potential of Marion Island for wind studies, as well the rate and impacts of climate change, is demonstrated by the presence of a permanent meteorological research station on the island. This station was established as early as 1948, and run by the South African National Antarctic Programme (see Fig. 1).
The second dataset (B) reflects the wind direction of Jeffreys Bay wind farm, recorded every 10 min at 60 m height. Jeffreys Bay is one of the biggest wind farms in South Africa spanning 3700 hectares with a 138 MW capacity. This site's optimal wind conditions, relatively flat topography, minimal environmental constraints and its close proximity to the Eskom (electricity supply commission of South Africa) grid line, make it an ideal wind energy resource (see Fig. 2, left).
The last dataset (C) shows wind direction of Noupoort wind farm comprising 7500 hectares and providing a 80 MW capacity, recorded every 10 min at 20 m height. This site is significant because of the excellent wind conditions, its proximity to national roads for wind turbine transportation, the favourable construction conditions, municipality and local stakeholder support and the straightforward electrical connection into the Eskom grid (see Fig. 2, right). Figure 3 shows the map of South Africa with the locations of Marion island, Jeffreys Bay and Noupoort wind farms and rose plots of the wind direction in these regions. Table 1 shows the descriptive information about the datasets. The results in Table 1, confirm skewness presence in these datasets. Also the Boxplots and kernel density plots of these datasets in Fig. 4. The Boxplots emphasize that these wind direction datasets reveal skew patterns and the kernel density plots confirm multimodal patterns. kernel density estimate is a smoothed version of the histogram which is a useful alternative to the histogram for continuous data. Unlike the histogram, the kernel technique produces a smooth estimate of the density function, uses all sample points' locations and more convincingly suggests multimodality.

Materials and methods
Sine-skewed von Mises distribution. Most of the distributions on the unit circle share the common feature of being symmetric about their location µ ∈ [−π, π) . However, since the assumption that data is symmetric is often rejected, Ref. 29 introduced the k sine-skewed von Mises distribution with density function where I 0 (.) is the modified Bessel function of the first kind of order 0, µ ∈ [−π, π) is the location parameter, τ > 0 is the concentration parameter, −1 ≤ ≤ 1 is the skewness parameter and k is a positive integer. > 0 (1) f SSVM (θ; µ, τ , ) = 1 2πI 0 (τ ) exp(τ cos(θ − µ))(1 + sin(k(θ − µ))),  (  www.nature.com/scientificreports/ Parameter estimation. In this section, first, the MLEs of parameters for a mixture of SSVM is presented, followed by a Bayesian inference when all the weight, location, concentration and skewness parameters (w , µ , τ , ) are unknown.
Maximum likelihood estimation. The log-likelihood function of a mixture of SSVM in (2), can be represented as follows: By setting the partial derivatives of (3) with respect to ( w, µ, τ , ) to zero, the MLEs of (w, µ, τ , ) can be obtained. Since no closed-form expressions exist, numerical methods should be used to obtain the estimates. The DEoptim package 46 in R software which is based on the Differential Evolution (DE) algorithm 47 is used to obtain the MLEs. Differential evolution is a heuristic evolutionary method for global optimization that is effective in many problems of interest in science and technology and its significant performance as a global optimization algorithm on continuous numerical minimization problems has been extensively studied 48 . DEoptim has made this algorithm possible to easily apply in the R language and environment. DEoptim relies on repeated evaluation of the objective function in order to move the population toward a global minimum 46 .
Bayes estimation. Let θ = (θ 1 , θ 2 , . . . , θ n ) be a random sample of size n from a mixture of SSVM (see (2)). It should be noted that the number of components M is considered as a known parameter. Suppose the latent variable d = (d 1 , . . . , d n ) allocates the component that θ is sampled from. The probability of being attributed to component j is given by Therefore, for i = 1, . . . , n and j = 1, . . . , M www.nature.com/scientificreports/ It implies that conditional on d i , θ i is an independent observation from its respective component j that makes the inference easier because the problem reduces to inference for a single SSVM component. Therefore, conditional on d , the likelihood function can be expressed as Subsequently, we measure the uncertainty in the parameters with the following prior distributions for (w, µ, τ , ) . If the sample size is small, or available data provides only indirect information about the parameters of interest, the prior distribution becomes more important 49 . Ghaderinezhad et al. 50 implemented the Wasserstein impact measure (WIM) as a measure of quantifying prior impact. It helps us to choose between two or more given priors. Nakhaei Rad et al. 44 by using the WIM measure demonstrated that the combination of the von Mises, gamma and truncated normal distributions decreases the execution time in the Gibbs sampling algorithm. Thus, providing accurate parameter estimates for the skew Fisher-von Mises distribution 51 as well. Therefore, consider independent von Mises and gamma distributions with parameters (µ 0 , τ 0 ) and (α, β) as priors for µ and τ , respectively: For the skewness parameter , the truncated normal distribution on [−1, 1] is proposed with parameters ξ and σ 2 : is the density function of standard normal distribution and �(.) is its cumulative distribution function.
For the weight parameter w , the Dirichlet distribution with parameter c is considered as prior: 52 . Subsequently, the posterior distribution is: with π(w, µ, τ , ) from (5), (6) and (7). The full conditionals of parameters (w, µ, τ , , d) for using in the Gibbs algorithm follow from (8). Therefore the Gibbs sampler is as follows (see Algorithm 2): For θ = (θ 1 , θ 2 , . . . , θ n ) , a set of observations and ̟ = (w, µ, τ , ) , the posterior predictive distribution for a new data point θ new and d new (the corresponding latent switch variable associated with θ new ) is:

Evaluation and results
Simulation. In this section, to assess the performance of the proposed Bayesian approach a simulation study was conducted to estimate the parameters of SSVM in (1) Tables 2 and  3. As can be seen the differences between true values of the parameters and the posterior sample mean and the posterior sample median are minimal. Therefore, the proposed Bayesian approach provides accurate estimates for the parameters. The traceplots of the generated samples from the posteriors and the compare-partial plots 56 are shown in Fig. 6 for the mixture of SSVM. A traceplot is used for evaluating convergence which shows the time series of the sampling process from the posterior distribution. It is expected to get a traceplot that looks completely random. A compare-partial plot provides overlapped kernel density plots related to the last part AIC = −2l(̟ |θ) + 2k, BIC = −2l(̟ |θ) + k log n. Table 2. Bayes estimates of parameters of SSVM with prior parameters, µ 0 = 0, τ 0 = 0.01, α = 4, β = 2, ξ = 0.5 and σ = 0.01. www.nature.com/scientificreports/ of the chain (the last 10 values, in green) and the whole chain (in black). The overlapped kernel densities are expected to be similar. It means the initial and final parts of the chain should to be sampling in the same target posterior distribution. These plots in Fig. 6 confirm the convergence of the chains and show that the Gibbs sampler recovers the values that actually generate the dataset.
To evaluate the accuracy of the obtained Bayes estimates, the mean squared errors (MSE) of the estimates under squared error and absolute error loss functions for the mixture of SSVM with two components ( M = 2 ) with parameters which are mentioned above were obtained for different sample sizes n = 10, 25, 50, 100, 200, 300, 500 with 100 repetitions. The results in Fig. 7 show that by increasing n, MSE decreases and also, the MSEs of the estimates for absolute error loss function are less than squared error loss function because outliers have a smaller effect on the median.

Real data.
To demonstrate the performance of the SSVM for the wind direction data for South African hotspots, three real skewed datasets as discussed in "Site location and wind data" (see Table 1) were analyzed. Due to the multimodal pattern of the datasets observed in Fig. 4, the following distributions were assumed:  Table 4. A model with the maximum log-likelihood and minimum values of AIC and BIC provides better fit for the data. Therefore, for dataset A, the mixture of SSVM with k = 1 provides the best fit. Mixture of SSVM with k = 2 and the mixture of von Mises with M = 2 are the second and third best models, respectively. For datasets B and C, the mixture of SSVM with k = 2 provides the best fit and the mixture of von Mises with M = 4 is the second best model. In all of these datasets, the difference in the AIC and BIC values of the mixture of SSVM in comparison to the mixture of von Mises are remarkable. Furthermore, the mixture of SSVM with smaller value of M, outperformed the mixture of von Mises. The kernel density plots of the datasets and the fitted curves consisting of the best mixture of von Mises and mixture of SSVM for k = 1, 2 are shown in Fig. 8.
To demonstrate the performance of the proposed Bayesian approach, a mixture of two SSVM distributions is fitted to dataset A for k = 1 , and to dataset B and C with k = 2 . A sample of size n = 500 was generated from the posterior distribution in (8) for each model, using the Gibbs sampling outlined in Algorithm 2. The Bayes estimates of the parameters were obtained based on the squared error, absolute error and zero-one loss functions. For our purpose, the posterior mean, posterior median and posterior mode were calculated from the generated Table 3. Bayes estimates of parameters of a mixture of SSVM with prior parameters, µ 0 1 = 3 , τ 0 1 = 0.1 ,   Figure 6. Traceplots and estimated posterior density plots of generated samples for (w, µ 1 , τ 1 , 1 , µ 2 , τ 2 , 2 ) in Table 3 for n = 500.  Table 5. A model with minimum value of DIC has better fit for the data. The mentioned models above with parameters estimated based on the absolute error loss function provide more accurate fit for the datasets. The kernel density plots of the datasets and the fitted curves are shown in Fig. 9. In Table 6, using Algorithm 3, the predicted means of wind direction were obtained, based on absolute error loss function, for n = 20, 50, 100 . Also, 95% credible intervals are derived. We focused on the assumption of absolute error loss function as a result of the performance observed in Table 5. As can be seen, by increasing n, the mean value of the predictive wind direction distributions are getting closer to the mean value of the datasets. www.nature.com/scientificreports/ In addition, the length of the credible intervals is short. Therefore, our approach provides accurate prediction of wind direction.

Conclusion
In this paper, due to the skew and multimodal patterns of wind direction datasets from South Africa, a skew and multimodal mixture model, namely mixture of sine-skewed von Mises distributions is proposed for modeling wind direction. Our proposed model outperforms mixtures of von Mises distributions (with larger number of components) which is extensively used in literature to model wind direction. Due to the difficulties in estimating parameters for mixture models using maximum likelihood method, a Bayesian approach is implemented for estimating the parameters of a mixture of sine-skewed von Mises distributions using a Gibbs sampler. The results show this approach provides accurate estimates for parameters. In addition the posterior predictive distribution can be applied for wind direction prediction (see Table 6) which provides accurate forecasts.    www.nature.com/scientificreports/ may consist of implementing the models of Bekker et al. 57 and Kato and Jones 19 and investigating the impact of other prior choices 50 . One can use our proposal to improve the wind energy potential as described and detailed in Arashi et al. 58 .

Data availability
The datasets used and/or analysed during the current study available from the corresponding author on reasonable request.